<template>
  <div id="app">
    <!-- 只在首页、供方市场、需方市场、企业中心显示头部 -->
    <Header v-if="showHeader" />
    <router-view/>
    <Footer v-if="showFooter" />
  </div>
</template>

<script>
import Header from '@/components/Header.vue';
import Footer from '@/components/Footer.vue';
export default {
  name: 'App',
  components: {
    Header,
    Footer
  },
  computed: {
    showHeader() {
      // 在登录和注册页面不显示头部
      return !['login','register'].includes(this.$route.name);
    },
    showFooter() {
      // 在登录和注册页面不显示底部
      return !['login','register'].includes(this.$route.name);
    },
  },
  created() {
    document.title = '广西工业产品信息对接平台';
  }
};
</script>

<style>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

#app {
  font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #4E5969;
  min-height: 100vh;
  background: radial-gradient(circle at top right, #d5eafa, #fff);
}
</style>